webpackJsonp([1],{

/***/ 222:
/***/ (function(module, exports, __webpack_require__) {


/* styles */
__webpack_require__(711)

var Component = __webpack_require__(217)(
  /* script */
  __webpack_require__(622),
  /* template */
  __webpack_require__(687),
  /* scopeId */
  null,
  /* cssModules */
  null
)

module.exports = Component.exports


/***/ }),

/***/ 622:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(143);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex__ = __webpack_require__(144);




/* harmony default export */ __webpack_exports__["default"] = ({
	data: function data() {
		return {
			tableData: [],
			searchData: [],
			landAgentData: ["杭州合景", "杭州万科", "宁波万科"],
			dialogProjectTitle: '添加项目',
			sendProjectData: {
				keyword: '',
				indexfrom: 0,
				counts: 20
			},
			list: [],
			cur_page: 1,
			multipleSelection: [],
			select_cate: '',
			del_list: [],
			is_search: false,
			dialogFormVisible: false,
			dialogSiVisible: false,
			form: {
				project_name: '',
				address: '',
				landAgent_name: "",
				remark: ''
			},
			rules: {
				project_name: [{
					required: true,
					message: '请输入项目名称',
					trigger: 'blur'
				}, {
					max: 15,
					message: '项目名称限制15字以内',
					trigger: 'blur'
				}],
				address: [{
					required: true,
					message: '请输入地址',
					trigger: 'blur'
				}, {
					max: 30,
					message: '地址限制30字以内',
					trigger: 'blur'
				}],
				landAgent_name: [{
					required: true,
					message: '请输入开发商',
					trigger: 'blur'
				}]
			},
			landAgentList: [{
				text: '杭州合景',
				value: '杭州合景'
			}, {
				text: '杭州万科',
				value: '杭州万科'
			}],

			formLabelWidth: '120px',
			loading: false,
			landAgentloading: false
		};
	},
	created: function created() {
		this.getData();
	},

	computed: {
		data: function data() {
			var self = this;
			return self.tableData.filter(function (d) {
				var is_del = false;
				for (var i = 0; i < self.del_list.length; i++) {
					if (d.name === self.del_list[i].name) {
						is_del = true;
						break;
					}
				}
				if (!is_del) {
					if (d.address.indexOf(self.select_cate) > -1 && (d.name.indexOf(self.select_word) > -1 || d.address.indexOf(self.select_word) > -1)) {
						return d;
					}
				}
			});
		}
	},
	mounted: function mounted() {
		this.list = this.landAgentData.map(function (item) {
			return {
				value: item,
				label: item
			};
		});
	},

	methods: __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_vuex__["b" /* mapMutations */])(['changeProjcetData']), {
		handleCurrentChange: function handleCurrentChange(val) {
			this.cur_page = val;
			this.getData();
		},
		getData: function getData() {
			var self = this;
			this.loading = true;
			var nowUrl = self.gconfig.config.httpUrl + self.gconfig.config.ajaxUrl.project_list;
			self.$axios.get(nowUrl, {
				params: self.sendProjectData
			}).then(function (res) {

				self.tableData = res.data.list;
				self.loading = false;
			}).catch(function (e) {
				self.loading = false;
			});
		},
		search: function search() {
			console.log(this.sendProjectData);
			this.getData();
		},
		formatter: function formatter(res) {
			if (res.status == 0) {
				return "未安装";
			} else {
				return "已安装";
			}
		},
		filterState: function filterState(value, row) {
			return row.state === value;
		},
		handleEdit: function handleEdit(index, row) {
			console.log(index, row);

			this.dialogProjectTitle = "编辑项目";
			this.form = {
				project_name: row.project_name,
				address: row.address,
				landAgent_name: row.landAgent_name,
				remark: row.remark
			};
			this.dialogFormVisible = true;
		},
		handleCheck: function handleCheck(index, row) {
			var self = this;
			this.$router.push({
				path: '/projecttab',
				query: {
					id: row.project_id
				}
			});

			this.changeProjcetData({
				project_name: this.tableData[index].project_name,
				address: this.tableData[index].address,
				landAgent_name: this.tableData[index].landAgent_name,
				remark: this.tableData[index].remark
			});
		},
		handleDelete: function handleDelete(index, row) {
			var self = this;
			this.$confirm('此操作将永久删除该项目, 是否继续?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(function () {
				self.loading = true;
				var nowUrl = self.gconfig.config.httpUrl + self.gconfig.config.ajaxUrl.project_delete;
				self.$axios.post(nowUrl, { project_id: row.project_id
				}).then(function (res) {
					self.loading = false;
					self.$message({
						type: 'success',
						message: '删除成功!'
					});
				}).catch(function (e) {
					self.loading = false;
					self.$message({
						type: 'error',
						message: '删除失败!'
					});
				});
			}).catch(function () {});
		},
		addProject: function addProject() {
			this.form = {
				project_name: '',
				address: '',
				landAgent_name: '',
				remark: ''
			};
			this.dialogProjectTitle = "添加项目";
			this.dialogFormVisible = true;
		},
		submitForm: function submitForm(formName) {
			var _this = this;

			var self = this;
			this.$refs[formName].validate(function (valid) {
				if (valid) {
					var nowUrl = void 0;
					if (self.dialogProjectTitle == "添加项目") {
						nowUrl = self.gconfig.config.httpUrl + self.gconfig.config.ajaxUrl.project_add;
					} else {
						nowUrl = self.gconfig.config.httpUrl + self.gconfig.config.ajaxUrl.project_update;
					}
					_this.loading = true;
					self.$axios.post(nowUrl, self.form).then(function (res) {
						self.loading = false;
						if (res.data.result == 200) {
							self.dialogFormVisible = false;
							self.$message({
								type: 'success',
								message: res.data.message
							});
						} else {
							self.$message({
								type: 'error',
								message: res.data.message
							});
						}
					}).catch(function (e) {
						self.$message({
							type: 'error',
							message: '系统繁忙，请稍后再试！'
						});
						self.loading = false;
					});
				}
			});
		},
		handleSI: function handleSI() {
			this.dialogSiVisible = true;
		},
		handleSelectionChange: function handleSelectionChange(val) {
			this.multipleSelection = val;
		},
		remoteMethod: function remoteMethod(query) {
			var _this2 = this;

			this.form.landAgent_name = query;
			if (query !== '') {
				this.landAgentloading = true;
				setTimeout(function () {
					_this2.landAgentloading = false;
					_this2.searchData = _this2.list.filter(function (item) {
						return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
					});
				}, 200);
			} else {
				this.searchData = [];
			}
		}
	})
});

/***/ }),

/***/ 653:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(94)(false);
// imports


// module
exports.push([module.i, ".dialog-footer{text-align:center}.o-b-select{width:100%}.el-dialog__footer{padding-bottom:35px}.handle-box{margin-bottom:20px}.handle-select{width:120px}.el-select{width:100%}.handle-input{width:300px;display:inline-block}", ""]);

// exports


/***/ }),

/***/ 687:
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('div', {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: (_vm.loading),
      expression: "loading"
    }]
  }, [_c('div', {
    staticClass: "crumbs"
  }, [_c('el-breadcrumb', {
    attrs: {
      "separator": "/"
    }
  }, [_c('el-breadcrumb-item', [_c('i', {
    staticClass: "el-yaguan-shehuade"
  }), _vm._v(" 项目管理")])], 1)], 1), _vm._v(" "), _c('div', {
    staticClass: "handle-box"
  }, [_c('el-button', {
    staticClass: "handle-del mr10",
    attrs: {
      "type": "primary"
    },
    on: {
      "click": _vm.addProject
    }
  }, [_c('i', {
    staticClass: "el-icon-plus"
  }), _vm._v(" 添加项目")]), _vm._v(" "), _c('el-input', {
    staticClass: "handle-input mr10",
    attrs: {
      "placeholder": "项目名称或地址搜索"
    },
    model: {
      value: (_vm.sendProjectData.keyword),
      callback: function($$v) {
        _vm.$set(_vm.sendProjectData, "keyword", $$v)
      },
      expression: "sendProjectData.keyword"
    }
  }), _vm._v(" "), _c('el-button', {
    attrs: {
      "type": "primary",
      "icon": "search"
    },
    on: {
      "click": _vm.search
    }
  }, [_vm._v("搜索")])], 1), _vm._v(" "), _c('el-table', {
    ref: "multipleTable",
    staticStyle: {
      "width": "100%"
    },
    attrs: {
      "data": _vm.tableData
    },
    on: {
      "selection-change": _vm.handleSelectionChange
    }
  }, [_c('el-table-column', {
    attrs: {
      "prop": "project_name",
      "label": "项目名称",
      "width": "150"
    }
  }), _vm._v(" "), _c('el-table-column', {
    attrs: {
      "prop": "address",
      "label": "项目地址"
    }
  }), _vm._v(" "), _c('el-table-column', {
    attrs: {
      "prop": "landAgent_name",
      "label": "房开商名称",
      "filters": _vm.landAgentList
    }
  }), _vm._v(" "), _c('el-table-column', {
    attrs: {
      "prop": "status",
      "label": "安装状态",
      "formatter": _vm.formatter,
      "width": "120",
      "filters": [{
        text: '已安装',
        value: 1
      }, {
        text: '未安装',
        value: 0
      }],
      "filter-method": _vm.filterState
    }
  }), _vm._v(" "), _c('el-table-column', {
    attrs: {
      "label": "操作",
      "width": "250"
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function(scope) {
        return [_c('el-button', {
          attrs: {
            "size": "small"
          },
          on: {
            "click": function($event) {
              _vm.handleCheck(scope.$index, scope.row)
            }
          }
        }, [_vm._v("查看")]), _vm._v(" "), _c('el-button', {
          attrs: {
            "size": "small"
          },
          on: {
            "click": function($event) {
              _vm.handleEdit(scope.$index, scope.row, )
            }
          }
        }, [_vm._v("编辑")]), _vm._v(" "), _c('el-button', {
          attrs: {
            "size": "small",
            "type": "danger"
          },
          on: {
            "click": function($event) {
              _vm.handleDelete(scope.$index, scope.row)
            }
          }
        }, [_vm._v("删除")])]
      }
    }])
  })], 1), _vm._v(" "), _c('div', {
    staticClass: "pagination"
  }, [_c('el-pagination', {
    attrs: {
      "layout": "prev, pager, next",
      "total": 100
    },
    on: {
      "current-change": _vm.handleCurrentChange
    }
  })], 1), _vm._v(" "), _c('el-dialog', {
    attrs: {
      "title": _vm.dialogProjectTitle,
      "visible": _vm.dialogFormVisible
    },
    on: {
      "update:visible": function($event) {
        _vm.dialogFormVisible = $event
      }
    }
  }, [_c('el-form', {
    ref: "form",
    attrs: {
      "model": _vm.form,
      "rules": _vm.rules
    }
  }, [_c('el-form-item', {
    attrs: {
      "label": "项目名称",
      "label-width": _vm.formLabelWidth,
      "prop": "project_name"
    }
  }, [_c('el-input', {
    attrs: {
      "auto-complete": "off"
    },
    model: {
      value: (_vm.form.project_name),
      callback: function($$v) {
        _vm.$set(_vm.form, "project_name", $$v)
      },
      expression: "form.project_name"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "label": "地址",
      "label-width": _vm.formLabelWidth,
      "prop": "address"
    }
  }, [_c('el-input', {
    attrs: {
      "auto-complete": "off"
    },
    model: {
      value: (_vm.form.address),
      callback: function($$v) {
        _vm.$set(_vm.form, "address", $$v)
      },
      expression: "form.address"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "label": "开发商",
      "label-width": _vm.formLabelWidth,
      "prop": "landAgent_name"
    }
  }, [_c('el-select', {
    attrs: {
      "filterable": "",
      "remote": "",
      "placeholder": "请输开发商关键词",
      "remote-method": _vm.remoteMethod,
      "loading": _vm.landAgentloading
    },
    on: {
      "blur": function($event) {}
    },
    model: {
      value: (_vm.form.landAgent_name),
      callback: function($$v) {
        _vm.$set(_vm.form, "landAgent_name", $$v)
      },
      expression: "form.landAgent_name"
    }
  }, _vm._l((_vm.searchData), function(item) {
    return _c('el-option', {
      key: item.value,
      attrs: {
        "label": item.label,
        "value": item.value
      }
    })
  }))], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "label": "备注",
      "label-width": _vm.formLabelWidth
    }
  }, [_c('el-input', {
    attrs: {
      "type": "textarea"
    },
    model: {
      value: (_vm.form.remark),
      callback: function($$v) {
        _vm.$set(_vm.form, "remark", $$v)
      },
      expression: "form.remark"
    }
  })], 1)], 1), _vm._v(" "), _c('div', {
    staticClass: "dialog-footer",
    attrs: {
      "slot": "footer"
    },
    slot: "footer"
  }, [_c('el-button', {
    on: {
      "click": function($event) {
        _vm.dialogFormVisible = false
      }
    }
  }, [_vm._v("取 消")]), _vm._v(" "), _c('el-button', {
    attrs: {
      "type": "primary"
    },
    on: {
      "click": function($event) {
        _vm.submitForm('form')
      }
    }
  }, [_vm._v("确 定")])], 1)], 1), _vm._v(" "), _c('el-dialog', {
    attrs: {
      "title": "分配SI",
      "visible": _vm.dialogSiVisible
    },
    on: {
      "update:visible": function($event) {
        _vm.dialogSiVisible = $event
      }
    }
  }, [_c('el-form', {
    attrs: {
      "model": _vm.form
    }
  }, [_c('el-form-item', {
    attrs: {
      "label": "选择SI",
      "label-width": _vm.formLabelWidth
    }
  }, [_c('el-select', {
    staticClass: "o-b-select",
    attrs: {
      "placeholder": "请选择开发商"
    },
    model: {
      value: (_vm.form.propertyDevelopers),
      callback: function($$v) {
        _vm.$set(_vm.form, "propertyDevelopers", $$v)
      },
      expression: "form.propertyDevelopers"
    }
  }, [_c('el-option', {
    attrs: {
      "label": "万科",
      "value": "wanke"
    }
  }), _vm._v(" "), _c('el-option', {
    attrs: {
      "label": "绿城",
      "value": "lvcheng"
    }
  })], 1)], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "label": "备注",
      "label-width": _vm.formLabelWidth
    }
  }, [_c('el-input', {
    attrs: {
      "type": "textarea"
    },
    model: {
      value: (_vm.form.info),
      callback: function($$v) {
        _vm.$set(_vm.form, "info", $$v)
      },
      expression: "form.info"
    }
  })], 1), _vm._v(" "), _c('div', [_c('el-button', {
    on: {
      "click": function($event) {
        _vm.dialogSiVisible = false
      }
    }
  }, [_vm._v("取 消")]), _vm._v(" "), _c('el-button', {
    attrs: {
      "type": "primary"
    },
    on: {
      "click": function($event) {
        _vm.dialogSiVisible = false
      }
    }
  }, [_vm._v("确 定")])], 1)], 1)], 1)], 1)
},staticRenderFns: []}

/***/ }),

/***/ 711:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(653);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(216)("2c636f1e", content, true);

/***/ })

});